﻿using System;

namespace Sustainalytics.Utils
{
    public static class ScoreConversion
    {
        public static string GetEventSeverity(int category)
        {
            switch (category)
            {
                case 1:
                    return "Low";
                case 2:
                    return "Moderate";
                case 3:
                    return "Significant";
                case 4:
                    return "High";
                case 5:
                    return "Severe";
                default:
                    return String.Empty;
            }
        }

        public static string GetOutlookAssessment(int outlook)
        {
            switch (outlook)
            {
                case -1:
                    return "Negative";
                case 0:
                    return "Neutral";
                case 1:
                    return "Positive";
                default:
                    return String.Empty;
            }
        }

        public static int GetRoundedScore(double item)
        {
            return (int)(System.Math.Round(item, 0, System.MidpointRounding.AwayFromZero));
        }
        public static int GetRoundedScoreToEven(double item)
        {
            return (int) item;
        }
    }
}

